package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**新服助力活动排行榜记录*/
@Getter
@Setter
public class NewHelpRankRecord extends RankRecord {
    private String gid;
    private String name;
    private int count;

    public NewHelpRankRecord() {}

    public NewHelpRankRecord(String gid, String name, int count) {
        this.gid = gid;
        this.name = name;
        this.count = count;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按购买数量从大到小排序*/
        NewHelpRankRecord other = (NewHelpRankRecord)o;
        if (count != other.getCount()) {
            return count > other.getCount() ? -1 : 1;
        }

        /**击杀数一样时，就按gid排序吧，保证不是同一个玩家就好了*/
        return gid.compareTo(other.getGid());
    }
}
